package com.probiz.estore.common.model.product.base;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.probiz.estore.common.model.product.Product;
import com.probiz.estore.common.model.product.ProductTypeBrand;
import com.probiz.estore.core.model.BaseObject;

/**
 * Brand Base Java Bean, base class for the model, mapped directly to database table
 * 
 * Avoid changing this file if not necessary, will be overwritten. 
 *
 */
public class BrandTbl extends BaseObject implements Serializable {

    protected Integer brandId;
	protected String brandName;
	protected Integer sortOrder;
	protected String website;
	protected String imageUrl;
	protected String shortDescription;
	protected String fullDescription;
	protected Integer version;
	protected Set<Product> products = new HashSet<Product>();
	protected Set<ProductTypeBrand> productTypeBrands = new HashSet<ProductTypeBrand> ();

    /**
	 * Default Empty Constructor for class Brand
	 */
	public BrandTbl () {
		super();
	}
	
	/**
	 * Default Key Fields Constructor for class Brand
     *  @param in_brandId 品牌id
	 */
	public BrandTbl (Integer in_brandId) {
        this.setBrandId(in_brandId);
    }


	
    

	public Set<Product> getProducts() {
		return products;
	}

	public void setProducts(Set<Product> products) {
		this.products = products;
	}

	public Set<ProductTypeBrand> getProductTypeBrands() {
		return productTypeBrands;
	}

	public void setProductTypeBrands(Set<ProductTypeBrand> productTypeBrands) {
		this.productTypeBrands = productTypeBrands;
	}

	/**
	 * 	 * @return Integer
     * @hibernate.id column="brandId" type="java.lang.Integer" generator-class="native"
	 */
	public Integer getBrandId() {
		return this.brandId;
	}
	
	/**
	 * Set the brandId
	 */	
	public void setBrandId(Integer aValue) {
		this.brandId = aValue;
	}	

	/**
	 * 品牌名称	 * @return String
	 * @hibernate.property column="brandName" type="java.lang.String" length="64" not-null="true" unique="false"
	 */
	public String getBrandName() {
		return this.brandName;
	}
	
	/**
	 * Set the brandName
	 * @spring.validator type="required"
	 */	
	public void setBrandName(String aValue) {
		this.brandName = aValue;
	}

    public String getShortDescription() {
        return shortDescription;
    }

    public void setShortDescription(String shortDescription) {
        this.shortDescription = shortDescription;
    }

    public String getFullDescription() {
        return fullDescription;
    }

    public void setFullDescription(String fullDescription) {
        this.fullDescription = fullDescription;
    }

    /**
	 * 	 * @return Integer
	 * @hibernate.property column="sortOrder" type="java.lang.Integer" length="10" not-null="false" unique="false"
	 */
	public Integer getSortOrder() {
		return this.sortOrder;
	}
	
	/**
	 * Set the sortOrder
	 */	
	public void setSortOrder(Integer aValue) {
		this.sortOrder = aValue;
	}	

	/**
	 * 	 * @return String
	 * @hibernate.property column="website" type="java.lang.String" length="255" not-null="false" unique="false"
	 */
	public String getWebsite() {
		return this.website;
	}
	
	/**
	 * Set the website
	 */	
	public void setWebsite(String aValue) {
		this.website = aValue;
	}	

	/**
	 * 	 * @return String
	 * @hibernate.property column="logo" type="java.lang.String" length="255" not-null="false" unique="false"
	 */
	public String getImageUrl() {
		return this.imageUrl;
	}
	
	/**
	 * Set the logo
	 */	
	public void setImageUrl(String aValue) {
		this.imageUrl = aValue;
	}	

	/**
	 * 	 * @return Integer
	 * @hibernate.property column="version" type="java.lang.Integer" length="10" not-null="true" unique="false"
	 */
	public Integer getVersion() {
		return this.version;
	}
	
	/**
	 * Set the version
	 * @spring.validator type="required"
	 */	
	public void setVersion(Integer aValue) {
		this.version = aValue;
	}	

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof BrandTbl)) {
			return false;
		}
		BrandTbl rhs = (BrandTbl) object;
		return (this.brandId.equals(rhs.brandId))?true:false;
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973)
				.append(this.brandId) 
				.toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("brandId", this.brandId) 
				.append("brandName", this.brandName) 
				.append("sortOrder", this.sortOrder) 
				.append("website", this.website) 
				.append("imageUrl", this.imageUrl)
				.append("version", this.version) 
				.toString();
	}

	/**
	 * Return the name of the first key column
	 */
	public String getFirstKeyColumnName() {
		return "brandId";
	}
	
	/**
	 * Return the Id (pk) of the entity, must be Integer
	 */
	public Integer getId() {
		return brandId;
	}

}